Skip to content

Storage - STG102 IPv6#48468

Merged
ibrandes merged 10 commits intoAzure:feature/storage/stg102basefrom
browndav-msft:stg102/ipv6
Mar 23, 2026
Merged

Storage - STG102 IPv6#48468
ibrandes merged 10 commits intoAzure:feature/storage/stg102basefrom
browndav-msft:stg102/ipv6

Conversation

@browndav-msft
Copy link
Member

  • Refactor duplicate code in BuilderHelpers and BlobUrlParts so that they use storageImplUtils.getAccountNameFromHost()
  • Left original getAccountName with single param, created overload with ServiceSubDomain
  • Created static values for URI_SUBDOMAINS in common Constants class

@github-actions github-actions bot added the Storage Storage Service (Queues, Blobs, Files) label Mar 19, 2026
@browndav-msft browndav-msft requested a review from Copilot March 19, 2026 02:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors storage endpoint parsing to centralize account-name extraction in StorageImplUtils, including support for suffix variants like -secondary, -dualstack, and -ipv6. It also introduces shared constants for service subdomains and adds/updates tests to validate the new parsing behavior.

Changes:

  • Replaced duplicated “account name from host” parsing in Queue and File Share builders and in BlobUrlParts with StorageImplUtils.getAccountNameFromHost(...).
  • Added StorageImplUtils.getAccountName(URL, serviceSubDomain) overload plus a new getAccountNameFromHost(host, serviceSubDomain) helper that strips known endpoint suffixes.
  • Added Constants.<Service>.URI_SUBDOMAIN constants and new/updated tests for the suffix parsing behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
sdk/storage/azure-storage-queue/.../BuilderHelper.java Uses StorageImplUtils.getAccountNameFromHost for queue endpoint parsing.
sdk/storage/azure-storage-file-share/.../BuilderHelper.java Uses StorageImplUtils.getAccountNameFromHost for file endpoint parsing and account-name extraction.
sdk/storage/azure-storage-common/.../StorageImplUtilsTests.java Adds parameterized tests to validate service-subdomain-based parsing and suffix stripping.
sdk/storage/azure-storage-common/.../StorageImplUtils.java Adds overload/helper to extract account name from host and strip known suffixes.
sdk/storage/azure-storage-common/.../Constants.java Adds shared service subdomain constants (Constants.Blob/File/Queue/Table/Dfs.URI_SUBDOMAIN).
sdk/storage/azure-storage-blob/src/test/java/BlobUrlPartsTests.java Adds a new test validating BlobUrlParts.parse() behavior for suffix variants.

@ibrandes ibrandes changed the title refactor so BuiderHelpers and BobUrlParts use StorageImplUtils Storage - STG102 IPv6 Mar 19, 2026
@ibrandes ibrandes marked this pull request as ready for review March 22, 2026 20:28
Copy link
Member

@ibrandes ibrandes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@ibrandes ibrandes merged commit 2a45793 into Azure:feature/storage/stg102base Mar 23, 2026
22 of 25 checks passed
ibrandes added a commit that referenced this pull request Mar 24, 2026
* Stg102/versions (#48118)

* bump latest service version from 2026_04_06 to 2026_06_06 for stg102

* refactor transformutils to use switch

* made changes based on comments

* Stg102/datalake tags (#48057)

* get tags

* set tags

* sas permissions for tag

* adding tag to datalake sas model tests

* add only datalake files from 38db6fd

* fix linting errors:remove unused imports, add return annotation setTags method

* fix sasPermissionsParseSupplier test

* recorded tests for DirectoryApiTests.getSetTags()

* split getSetTagsAC into getTagsAC and setTagsAC

* record tests for getTagsAC and setTagsAC

* change generatePathName() to dc.getDirectoryPath

* create recordings for getSetTagsDirectorySas

* Record DirectoryApiTests#getSetTagsOAuth

* Record DirectoryApiTests#getSetTagsLease

* Record DirectoryApiTests#getTagsLeaseFailed

* Record DirectoryApiTests#setTagsLeaseFailed

* Record DirectoryApiTests#getSetTagsFileSystemSas

* Record DirectoryApiTests#getSetTagsAccountSas

* Record DirectoryApiTests#getSetTagsDirectoryIdentitySas

* Record DirectoryApiTests#getSetTagsFileSystemIdentitySas

* Record DirectoryApiTests#getTagsError

* Record DirectoryApiTests#setTagsError

* Record DirectoryApiTests#setTagsACFail

* Record DirectoryApiTests#getTagsACFail

* Add x-ms-blob-if-modified/unmodified-since to CustomMatcher headers in DataLakeTestBase

This matches the behavior in BlobBaseTest https://github.com/Azure/azure-sdk-for-java/blob/a86d1fbe0002f087552c78e32df5447665d53939/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/BlobTestBase.java#L202
- This adds x-ms-blob-if-modified/unmodified. Four tests use NEW_DATE and OLD_DATE, which change the date in the header. We can't change this because the data comes from a supplier that is used by other tests and the other tests pass.
- The reason we have to do this is because getTagsWithResponse and setTagsWithResponse both delegate to blockBlobClient, which uses  instead of  like the rest of DFS.

* Re-record getTagsAC with full access conditions

* update comment in sasPermissionsToStringSupplier

* setTags returns Mono<Void> but maps Response::getValue, which will be null for Response<Void>. Reactor doesn't allow emitting null, so this will likely fail with an NPE when subscribed. Use the same pattern as other void-returning APIs in this client (e.g., setMetadata): convert the Mono<Response<Void>> to a completion-only Mono<Void> (such as flatMap(FluxUtil::toMono) or then()).

* make DLgettags and settags options classes final

* create aysnc tests based on sync tests

* Update recordings for DirectoryAsyncApiTests

---------

Co-authored-by: Isabelle <[email protected]>

* Storage - Stg102 create file with data (#48164)

* revert pull changes from STG100 for all files

* add all tests, bump version from 2026-02-06 to 2026-06-06

* fix filePropertySemantics not getting passed, recorded tests

- filePropertySemantics was not getting passed as an arg for the function in ShareDirectoryClient or ShareDirectoryAsyncClient
- created recordings for the new tests

* pass filePropertySemantics to createWithResponse service method

* create new recordings for missing tests

* fix java docs, change ternary to fluxMD5wrapper

* remove local config file

* Storage - STG102 Put Block, Put Block from URL, and Put Block List with UDS create permission (#48390)

* finish upload for put block

* add test for transfer with create permission

* add recording for transferBlobWithCreatePermission

* create commitBlockLIst sync with recording

* create transfer async with recording

* finish commitblocklist with permission and recording

* wrap user-delegation SAS tests  in liveTestScenarioWithRetry(...)

Co-authored-by: Copilot <[email protected]>

* add sanitizer for skoid

* accept sanitization recommendation from copilot

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

* remove unncessary arg from lambda

* made sanitization recommendations from copilot, rerecorded tests

* add key.setSignedObjectId(testResourceNamer.recordValueFromConfig(key.getSignedObjectId())), rerecord tests

---------

Co-authored-by: Copilot <[email protected]>

* Storage - STG102 object level smart access (#48392)

* generate new api based on swaggerfile

* create base test for new api

* switch to premiumstorageaccount for smart-tier

* recording for setblobaccesstiersmart

* rerecording for setblobaccesstiersmart

* updating assets

* add SMART access tier in enum, accessTierInferred and smartAcessTier to PathProps

* create basic test for smart tier in datalake

* fix linting in PathProperties

* fixed broken deps for FileApiTest#getInferredTierWhenAssignedSmart

- We needed to add AccessTier smartAccessTier to all constructors in BlobProperties, which is different than what is recommended in BlobPropertiesInternal. Made a deliberate decision to go this route, but will go the other route, if necessessary

* changed boolean to Boolean to allow for null

* add premiumDataLakeServiceClient for smart tier

* remove code to test access tier smart on get props for datalake

@test
@RequiredServiceVersion(clazz = DataLakeServiceVersion.class, min = "2026-02-04")
public void getInferredTierWhenAssignedSmart() {
    // Arrange
    // Create a file in a file system with the smart tiering feature enabled, and set the access tier to smart.
    // Did this manually to prove feature works
    fc = premiumDataLakeServiceClient.getFileSystemClient("5333bf800setblobaccesstiersmart26f99030889cd17d8581")
        .getFileClient("5333bf801setblobaccesstiersmart26f71508c0c760a5e356");

    Response<PathProperties> response = fc.getPropertiesWithResponse(null, null, null);
    HttpHeaders headers = response.getHeaders();
    PathProperties properties = response.getValue();

    validateBasicHeaders(headers);

    assertEquals(AccessTier.SMART, properties.getAccessTier());
    assertEquals(AccessTier.HOT, properties.getSmartAccessTier());
}

* add params for smartAccessTier to javadocs

* removing breaking changes

* removing datalake breaking changes

* add recordings for BlobBaseApiTests

* add recordings for BlobApiTests#uploadStreamAccessTierSmart

* add recordings for BlobAsyncApiTests#uploadStreamAccessTierSmart

* add recordings for BlobAsyncApiTests#uploadStreamAccessTierSmart

* uncomment a reqeust in setTierAllSucceed

* remove javadoc params for smartAccessTier

* change getSmartAccessTier to return actual value instead of null

* finmish startCopyFromURLSmartAccessTier, no recording

* finish creating async versions of sync tests

* add recordings

* make uploadStreamAccessTierSmart more concise

* rerecord for uploadStreamAccessTierSmart

* remove unused variables from Transforms and DataLakeTestBase

* restore the previous way of setting teh accessor

* wrap tests in StepVerifier.create()

* update javadocs description for getSmartAccessTier, fix casing on variable

* wrap tests in StepVerifier.create()

* rerecord for BatchApiTest#setTierAllSucceed

* rerecord for missing tests

* remove unused imports

* remove unused imports

---------

Co-authored-by: Isabelle <[email protected]>

* Storage - STG102 Directory-Level SAS on Blob FNS (#48477)

* wip

* more tests

* addressing copilot comments and adding async tests

* addressing more copilot comments

* adding extra verification to sas tests

* adding recordings

* resolving analyze error

* Storage - STG102 IPv6 (#48468)

* refactor so BuiderHelpers and BobUrlParts use StorageImplUtils

* fix linting issues

* fix linting issues

* fix spacing issue in Constant file

* add connection string parse test

* finish builderhelper tests

* finish refactor of BuilderHelperTests

* remove unused imports

* remove throw for illegal exception

* remove subclasses for uri constants

* pointing swagger input file to azure instead of fork

* re-generating from swagger

* adding features to changelogs

* changing param name tagsPermission to hasTagsPermission

* adjusting share file client create impl calls after new swagger

* bumping swagger version and re-generating

* autorest generation for file share

* Update sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobUrlParts.java

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: browndav-msft <[email protected]>
Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants